/**
 * Apr 2, 2011
 * 8:32:18 PM
 * Timiz
 * kukujun@gmail.com
 *cn.lastjune.dao.impltimiz-project-dpAreaDaoImpl
 */
package cn.lastjune.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import cn.lastjune.dao.AreaDao;
import cn.lastjune.dao.GenericDao;
import cn.lastjune.pojo.Area;

/**
 * Timiz
 * kukujun@gmail.com
 */
@Repository
public class AreaDaoImpl extends HibernateDao<Area, String> implements GenericDao<Area, String>, AreaDao
{

    @Override
    public Area getAreaByID(String id)
    {
        return this.get(id);
    }
    @SuppressWarnings("unchecked")
	@Override  
    public List<Object[]> getRate(){
    	final String sql = "select happenarea,count(happenarea) as Rate from Area"
			+ " group by happenarea";
    	return this.getSession().createQuery(sql).list();
    }
}
